package com.sh.utils;

import org.apache.commons.lang3.StringUtils;

public class RedisKeyUtil {
    public static String getPermissionKey(String storeType, String userId, String bucket, String path) {
        if (StringUtils.isEmpty(path)) {
            return String.format("%s_%s_%s", storeType, userId, bucket);

        }
        return String.format("%s_%s_%s_%s", storeType, userId, bucket, path);
    }

    public static String getBucketPermissionKey(String storeType,String userId,String bucket){
        return String.format("%s_%s_%s_*",storeType,userId,bucket);
    }

}
